//
// Created by 1065246 on 2023/4/27.
//

#include "FilerWr.h"
#include <fstream>
#include <iostream>

using namespace std;
void FilerWr::wite() {
    std::ofstream ofstream;
    ofstream.open("./test.txt", ios::out);
    ofstream << "name:zhouyu" << endl;
    ofstream << "sex:man" << endl;
    ofstream << "age:30" << endl;
    ofstream.close();
}

void FilerWr::read() {
    std::ifstream ifstream;
    ifstream.open("test.txt",ios::in);
    if(!ifstream.is_open()){
        cout<<"open fail"<< endl;
    }

    string  bufffer;
    while (getline(ifstream,bufffer)){
        cout<<bufffer<<endl;
    }
    ifstream.close();
}